Formatting Tests

This page aims to test how different combinations of Notion text- and block-formatting are handled by Importer.

Some tests are very basic, but many have been added to demonstrate some very specific cases of formatting that are known to easily break during the conversion to Obsidian. Some formatting errors may break the entire page, whereas others may be subtle or go unnoticed — such as when a linebreak is inserted in slightly the wrong place, or bits of text disappear.

Ideally, this page should have near-identical formatting and structure when converted, bar any unsupported page/text elements. Also, the resulting Obsidian MD source should be readable and stylistically consistent in its own right.

Note: fixing one issue can cause a new issue or resurface an old one — keep checking previously resolved issues and add tests for new ones.

Blocks, Line-breaks, Indents, Spacing

Check for the following issues:

The above rules should also apply when nested in callouts or quotes, unless stated otherwise.


A normal text block, equal to a single paragraph.

A text block, equal to a single paragraph but with a
forced linebreak and
text-formatting here.

A new text block with two consecutive forced linebreaks below—

—still the same block down here, but equivalent to a new paragraph in Obsidian.

An unindented text block, equal to a single paragraph.

An indented text bock, equal to a single new paragraph.

A further-indented text block, equal to a single new paragraph.

This is all in bold but there’s a double line-break

here that should be split apart.

Here is some continuously striken-out text
with a sudden line-break right here,

and again right here but also with nested bold text!

We have some more text here; let’s see if this has survived the formatting issues from above — we have contained this in a blockquote to stop the errors propagating to the rest of the file.


First paragraph (text block) within this quote block; the same behaviour should apply as with non-quoted text.

A new paragraph within the quote block but with a
forced linebreak and
text-formatting here.

A new text block with two consecutive forced linebreaks below—

—still the same block down here, but equivalent to a new paragraph in Obsidian.

Title of the callout…
with a
linebreak here.

This paragraph of the callout…
has a
linebreak here.

This paragraph of the callout…

has a
double linebreak here.

A Formatted Callout Title

The formatting should work as normal within the title.

Callout body with no title.

Nested Formatting

A Highlighted Heading

Here is some text that has been highlighted multiple times.

Quotes, Callouts + Nesting

It may be useful to encode Obsidian callouts as modified quote-blocks. We just need to check that the [ ] are not escaped after import.


Here is a quote with lots of Nesting

First a nested block equation:

∣x∣={−x:x<0x:x≥0|x| = \begin{cases} -x : & x \lt 0 \\ x : & x\ge 0 \end{cases}
And a nested quote
Inside a quote
Inside a quote
Inside a quote

And more math:

∣x∣={−x:x<0x:x≥0|x| = \begin{cases} -x : & x \lt 0 \\ x : & x\ge 0 \end{cases}

Truly incredible!

Check that this has been de-nested correctly

And that it is separate from the following block.

[!tip] Quote With [!tip] in Title

Adding [!tip] in a Notion quote creates an Obsidian callout

[!tip] Nested Callout-Quote

We can do it again to nest!

Title for Callout

Below we have a nested callout.

Title for Nested Callout

Here is a new paragraph block in the nested callout!

Title for Double-Nested Callout

Here is a new paragraph block in the double-nested callout!

Adding more nested math for fun:

∣x∣={−x:x<0x:x≥0|x| = \begin{cases} -x : & x \lt 0 \\ x : & x\ge 0 \end{cases}

It should look pristine, even in source-editor mode.

Lists + Nesting

Hashtags

Hashtags have no special meaning in Notion; in Obsidian they create tags when followed by a series of characters that can contain:

Note: there must be at least one non-numeric character in the tag.


The following are recognised as tags in Obsidian so must be escaped during import:

The following are not recognised as tags, so must not be escaped:

The following are already escaped for special syntax eg for math or links to headers, so must not be escaped twice or the blocks will break:

Mathematical Equations

Math in Callouts

Below is a callout showing a mathematical function.

Title for Callout

This paragraph block is about the complex exponential function:

f(t)=Aeiωt,f(t)=Ae^{i\omega t},

where tt is time.

Title for Multiline Math Nested in Callout

This paragraph block is about the complex exponential function:

f(t)=Aeiωtg(t)=Beiσt,\begin{align} f(t) &=Ae^{i\omega t} \\ g(t) &= Be^{i\sigma t}, \end{align}

where tt is time. And f(x)=g(x)f(x) = g(x) when A=B={1:x>00:x<0\small A= B = \begin{cases} 1:x>0 \\ 0:x<0 \end{cases}.

Math in Text

The complex exponential function is

f(t)=Aeiωt,f(t)=Ae^{i\omega t},

where tt is time.

Math with Cases

Here is the definition for the absolute value function:

∣x∣={−x:x<0x:x≥0|x| = \begin{cases} -x : & x \lt 0 \\ x : & x\ge 0 \end{cases}

Math with Trailing Spaces & Linebreaks


  1. f(x)f(x) has no trailing spaces: $f(x)$.
  1. g(x) g(x)  has two trailing spaces: $ g(x) $.
  1. h(x) h(x)\  has an escaped trailing space: $h(x)\ $.
  1. p(x)=ex p(x) = e^{x}  has trailing linebreaks: $<br><br>p(x) = e^{x}<br><br>$.

Multiline display math with trailing space:

$$  \ \\\mathrm{abs}(x)=|x|
=\begin{cases} 
-x : & x \lt 0 \\
x  : & x\ge 0
\end{cases}\\
\      
   $$
 abs(x)=∣x∣={−x:x<0x:x≥0  \ \\\mathrm{abs}(x)=|x| =\begin{cases} -x : & x \lt 0 \\ x : & x\ge 0 \end{cases}\\ \

Math With # Variables

Here is a complicated looking bit of math that uses a # variable in a user-defined command:

v˙α=fα(t)+ξα(t)fα(t)=1τα(vˉα−vα)+∑β≠αfαβ(t)+∑ifαi(t)\renewcommand{\vec}[1]{\boldsymbol{#1}} \begin{align*} \vec{\dot v}_\alpha &= \vec f_\alpha (t) + \vec\xi_\alpha(t) \\ \vec f_\alpha (t) &= {1\over\tau_\alpha} (\vec{ \bar v}_\alpha - \vec v_\alpha) + \sum_{\beta≠\alpha}\vec f_{\alpha\beta}(t) + \sum_{i}\vec f_{\alpha i}(t) \end{align*}

Internal Links

Currently, Notion does not export standalone internal links to headings or blocks, only standalone links to other pages, or links within table of contents. This appears to be a bug.


Link to heading:

https://www.notion.so/Formatting-Tests-1580080aa5a380d1b0c7c2f979343d88?pvs=4#1590080aa5a380f7a294ee21d69095dc

Link to text block:

https://www.notion.so/Formatting-Tests-1580080aa5a380d1b0c7c2f979343d88?pvs=4#15b0080aa5a3805aba38c10161727d4c


Link to a another page: Block Reference

Link to heading in another page:

Link to text block in another page: